spring:
  application:
    name: sakila-batch
  datasource:
    billing-query:
      select concat(c.first_name, concat(' ', c.last_name)) as 'Customer Name',
        a.address ,
        c2.city ,
        c3.country,
        r.rental_date as 'Film Rental Date',
        datediff(current_date, r.return_date) as 'Date Diff',
        r.return_date ,
        f.title,
        f.rental_duration
        from customer c
        join address a
        on c.address_id = a.address_id
        join rental r on
        c.customer_id = r.customer_id
        join inventory i on
        r.inventory_id = i.inventory_id
        join film f
        on f.film_id = i.film_id
        join city c2
        on a.city_id = c2.city_id
        join country c3
        on c2.country_id = c3.country_id
        where 'Date Diff' is not null
        order by 'Date Diff' asc
  mail:
    host: smtp.gmail.com
    port: 587
    username: 'johnmresler@gmail.com'
    recipients: 'jmresler@yahoo.com'
    subject: 'Batch Processing Status'
    text:
      '''
        This is a message from %s to %s
      '''
    password: 'ddgr iquk kqav vxge'
    properties:
      encoding: 'UTF-8'
      mail:
        # api-key: 'AIzaSyBIEvubhI8ow1mKoupOpHXy3jGz5JpwC8M'
        smtp:
          auth: true
          starttls:
            enable: true
      path-to-attachment: 'src/main/resources/templates/processing-report.ftl'

    protocol: smtp
  profiles:
    active: ${RUNTIME_ENV:h2}